// packageI/newMedia/components/adArticleItem/adArticleItem.js
var app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    item:{
      value:{},
      type:Object
    },
    labelShow:{
      value:false,
      type:Boolean
    },
    clickShow:{
      value:false,
      type:Boolean
    },
    index:{
      value:0,
      type:Number
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    typeArr:["","图文","文章","音频","视频"]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    gotoDetails(){
      let item = this.data.item;
      if(item.is_open!=1) return app.tips("广告已下架");
      if(item.type==2 || item.genre==4){
        let page = this.data.index;
        page = Math.ceil((page + 1) / 15);
        wx.navigateTo({
          url: '/packageI/newMedia/newMediaAdVideo/newMediaAdVideo?vid='+item.id + "&page=" + page + "&advertisingt_type="+item.type
        });
      }else {
        wx.navigateTo({
          url: '/packageI/newMedia/newMediaAdDetails/newMediaAdDetails?id='+item.id,
        });
      }
      
    }
  }
});
